package edu.sctu.wangfuxin.day20150601testtrain;

/**
 * Created by user06 on 2015/6/2.
 */
public class RunMain {
    public static void main(String[] args) {
        for(int i = 0;i<new SetPeopleData().setPeopleData().size();i++) {
            PeopleAppBean people = new SetPeopleData().setPeopleData().get(i);
            System.out.println("第" + (i + 1) + "个人" + people.getName());
            MonitoringSystem monitoringSystem = new MonitoringSystem(i);
            monitoringSystem.monitorTheThief(people);
            if (people.isIs_thief() && people.isIs_stealingsomething()) {
                System.out.println(people.getName()+"已被抓走！");
            }else{
                if (people.isIs_card()) {

                    if (new BaoGuoDeth(people).chaBaoGuo()) {
                        System.out.println("包裹有违禁品");
                    } else {
                        if (new BaoGuoDeth(people).chaWater()) {
                            System.out.println("水有问题");
                        } else {
                            if (people.getPice() > 2) {
                                System.out.println("进站");
                            } else {
                                new CardDeth().setPrice(10, people);
                                System.out.println("充值成功");
                            }
                            if (people.getPice() >= new CardDeth().getPrice(
                                    people.getStart(), people.getEnd())) {
                                System.out.println("出站,余额为:"
                                        + (people.getPice() - new CardDeth().getPrice(
                                        people.getStart(), people.getEnd())));
                                new Date().DateDeth(new CardDeth().getCount(people.getStart(),people.getEnd()));

                            } else {
                                new CardDeth().setPrice(10, people);
                                System.out.println("充值成功");
                            }
                        }

                    }
                } else {
                    System.out.println("买票");
                    if (new BaoGuoDeth(people).chaBaoGuo()) {
                        System.out.println("包裹有违禁品");
                    } else {
                        if (new BaoGuoDeth(people).chaWater()) {
                            System.out.println("水有问题");
                        } else {
                            System.out.println("出站");
                            new Date().DateDeth(new CardDeth().getCount(people.getStart(),people.getEnd()));
                        }
                    }
                }

            }
            monitoringSystem.monitorAccident(new RunningSubway().setRunningSubwayData().get(i));
        }
    }
}
